﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CubeGrid : MonoBehaviour, IComparable
{

    public CubeGrid parent;
    public RolyType gridType;

    public int x;
    public int y;

    public int F;
    public int G;
    public int H;

    Material material;

    private void Awake()
    {
        material = GetComponent<MeshRenderer>().material;
    }

    public void Show()
    {
        material.color = Color.black;
    }

    public int CompareTo(object obj)
    {
        CubeGrid cubeGrid = obj as CubeGrid;
        if (cubeGrid.F > this.F) return -1;
        else if (cubeGrid.F < this.F) return 1;
        else return 0;
    }
}
